package com.ruoyi.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;


import com.ruoyi.system.domain.result_entity.fileInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface FileInfoServiceMapper extends BaseMapper<fileInfo> {
    @Select("SELECT * FROM result_file_info WHERE file_hash = #{fileHash} LIMIT 1")
    fileInfo selectByFileHash(@Param("fileHash") String fileHash);

    // 2. 根据文件路径查询
    @Select("SELECT " +
            "id, " +
            "file_path AS filePath, " +
            "file_hash AS fileHash, " +
            "file_name AS fileName, " +
            "upload_time AS uploadTime, " +
            "page_count AS pageCount " +
            "FROM result_file_info " +
            "WHERE file_path = #{filePath} LIMIT 1")
    fileInfo selectByFilePath(@Param("filePath") String filePath);

}
